<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
  .container {
    width: 600px;
    height: 400px;
    display: flex;
    text-align: center;
    flex-direction: column;
  }
  .header {
    height: 30px;
    background-color: pink;
    line-height: 30px;
  }
  .content {
    display: flex;
    flex: 1;
    justify-content: center;
  }
  .footer {
    height: 30px;
    background-color: rgb(57, 117, 42);
    line-height: 30px;
  }
  .left-box {
    width: 40px;
    background-color: red;
    display: flex;
    /* 垂直居中 */
    align-items: center;
  }
  .right-box {
    width: 40px;
    background-color: gold;
    display: flex;
    align-items: center;
  }
  .mid-box {
    background-color: aqua;
    flex: 1;
    display: flex;
    align-items: center;
    /* 水平居中 */
    justify-content: center;
  }
</style>
<body>
  <div class="container">
    <div class="header">header固定高度</div>
    <div class="content">
      <div class="left-box">左侧固定宽度</div>
      <div class="mid-box">中间段自适应</div>
      <div class="right-box">右侧固定宽度</div>
    </div>
    <div class="footer">footer固定高度</div>
  </div>
</body>
</html>